package com.shensi.api.admin.client.device;

import com.shensi.api.admin.client.fallback.device.DeviceClientFallBack;
import com.shensi.api.admin.domian.device.dto.DeviceSyncDto;
import com.shensi.api.admin.domian.device.vo.TableDataInfoWithTimeVo;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import com.shensi.common.core.utils.DateUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = DeviceClientFallBack.class)
@Component
public interface DeviceSyncClient {


    /**
     * 查询双屏机同步列表
     */
    @GetMapping("/sync/list")
    public TableDataInfo list(@SpringQueryMap DeviceSyncDto deviceSync);

    /**
     * 查询双屏机同步列表
     */
    @GetMapping("/sync/dualScreen")
    public TableDataInfoWithTimeVo lisWithTime(@SpringQueryMap DeviceSyncDto deviceSync);


    /**
     * 导出双屏机同步列表
     */
//    @PostMapping("/sync/export")
//    public void export(HttpServletResponse response, DeviceSyncDto deviceSync);

    /**
     * 获取双屏机同步详细信息
     */
    @GetMapping(value = "/sync/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id);

    /**
     * 新增双屏机同步
     */
    @PostMapping("/sync/add")
    public AjaxResult add(@RequestBody DeviceSyncDto deviceSync);

    /**
     * 修改双屏机同步
     */
    @PutMapping("/sync")
    public AjaxResult edit(@RequestBody DeviceSyncDto deviceSync);

    /**
     * 删除双屏机同步
     */
    @DeleteMapping("/sync/{ids}")
    public AjaxResult remove(@PathVariable("ids") Long[] ids);

}
